package tech.aister.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 本来用来演示:
 *
 * @author success
 * @date 2025/3/3 10:56:55
 */
@Controller
@ResponseBody// 将返回结果转成json字符串
@RequestMapping("tt")
public class xx {

    //@ResponseBody//可以加在方法上
    @GetMapping
    public String hello(){
        System.out.println("get-ok...");
        //如果没有@ResponseBody,那么返回的结果当成是视图的逻辑路径
        //return "get-ok";
        return "/views/login.html";
    }

    @PostMapping
    public String hello01(){
        return "post-hello01";
    }

}
